package org.hit.burkun.cases.pipline;

import org.hit.burkun.db.DBHelper;
import org.hit.burkun.db.DBTypeConverter;
import org.hit.burkun.dbimport.FileBaseImport;
import org.hit.burkun.file.FileProcessHelper.FILE_TYPE;

public class GeneTermImport extends FileBaseImport {

	public GeneTermImport(String fullFileName, FILE_TYPE fileType,
			String tableName, DBHelper dbHelper, int totalPropertyNum,
			boolean hasAutoIncreasementID, DBTypeConverter typeConverter,
			LINE_SPLITER spliterType) {
		super(fullFileName, fileType, tableName, dbHelper, totalPropertyNum,
				hasAutoIncreasementID, typeConverter, spliterType);

	}

	@Override
	protected String[] forEachItem(String[] items) {
		// 3, synonyms 同义词
		for (int i = 0; i < items.length; i++) {
			if (items[i].equals("-")) {
				items[i] = null;
			}
		}
		if (items[15].length() == 8) {
			String year = items[15].substring(0, 4);
			String month = items[15].substring(4, 6);
			String day = items[15].substring(6, 8);
			items[15] = year + "-" + month + "-" + day;
		}
		return items;
	}

}
